home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / arexx / ww5prvfn.lha / PreviewFonts.rexx < prev   
OS/2 REXX Batch file  |  1996-04-19  |  2KB  |  102 lines

  1. /*********************************************/
  2. /*                                           */
  3. /*             PreviewFonts v1.0             */
  4. /*      An AREXX script for Wordworth 5      */
  5. /* By Adam Dawes (Adam@beachyhd.demon.co.uk) */
  6. /*              17th April 1996              */
  7. /*                                           */
  8. /*********************************************/
  9.  
  10.  
  11.     Options Results
  12.  
  13.  
  14. /*-- First try to locate Wordworth 5's font directory --*/
  15.  
  16.     success = open("fontpath","ENV:WordWorth/WWfonts")
  17.  
  18.     if success = 0 then do
  19.         RequestNotify "Unable to open ENV:Wordworth/WWfonts"
  20.         exit
  21.     end
  22.  
  23.     fontpath = readln("fontpath")
  24.  
  25.     call close("fontpath")
  26.  
  27.  
  28.  
  29. /*-- Make sure the path ends with either a "/" or a ":" --*/
  30.  
  31.     if right(fontpath,1) ~= ":" & right(fontpath,1) ~= "/" then fontpath = fontpath"/"
  32.  
  33.  
  34.  
  35. /*-- Try to open the font list file (to check that we've found it ok) --*/
  36.  
  37.     success = open("fontlist",fontpath"UFST/FontList")
  38.     if success = 0 then do
  39.         RequestNotify "Unable to open "fontpath"UFST/FontList"
  40.         exit
  41.     end
  42.     call close("fontlist")
  43.  
  44.  
  45. /*-- Sort the fontlist so that we can list them fonts in alphabetical order --*/
  46.  
  47.     address command "sort FROM "fontpath"UFST/FontList TO T:FontsSorted"
  48.  
  49.  
  50.  
  51. /*-- Find the sorts of fonts to scan --*/
  52.  
  53.  
  54.     WizardReq TITLE "PreviewFonts v1.0 by Adam Dawes" LABEL "Please select the type of fonts you wish to preview:" Button 0 "_Intellifont" Button 1 "_Postscript" Button 2 "_TrueType" Button "-2" "_All" Button "-1" "_Cancel"
  55.  
  56.     fonttype = Result
  57.     if fonttype = -1 then exit        /* user clicked "cancel" */
  58.  
  59.  
  60. /*-- Set the page up ready for the font previews --*/
  61.  
  62.     New
  63.     Address Value Result
  64.  
  65.     Document A4 "0.5cm" "0.5cm" "1cm" "1cm" 2 "0.5cm"
  66.  
  67.     CentreJustify
  68.  
  69.  
  70. /*-- Open our sorted fontlist file --*/
  71.  
  72.     success = open("fontlist","T:FontsSorted")
  73.     if success = 0 then do
  74.         RequestNotify "Unable to open T:FontsSorted"
  75.         exit
  76.     end
  77.  
  78.  
  79. /*-- Now read through all the fonts --*/
  80.  
  81.     do until eof("fontlist")
  82.         currfont = readln("fontlist")
  83.         thistype = right(currfont,1)
  84.         currfont = left(currfont,pos(",",currfont)-1)        
  85.  
  86.         if thistype = fonttype | fonttype = -2 then do
  87.             Font NAME currfont SIZE 16
  88.             Text currfont": Ea1"
  89.             NewParagraph
  90.         end
  91.     end
  92.  
  93.  
  94.  
  95. /*-- Close and dispose of the sorted fonts file --*/
  96.  
  97.     call close("fontlist")
  98.     address command "Delete T:FontsSorted QUIET"
  99.  
  100.  
  101.     RequestNotify "Finished!"
  102.